package users

import (
	"ginx/internal/router"

	"github.com/gin-gonic/gin"
)

type users struct{}

func (b *users) RouteRegister(rg *gin.RouterGroup) {
	users := rg.Group("/users") // 子路由前缀
	{
		// 注册和登录接口
		users.POST("/otpurl", NewV1().OtpUrl)
		users.POST("/register", NewV1().Register)
		users.POST("/login", NewV1().Login)

		// 用户管理接口

		users.GET("/:id", NewV1().QueryById)
		users.GET("", NewV1().QueryAll)

	}
}

func init() {
	router.RegisterRoute(&users{})
}
